#include "Thread.hpp"

void test()
{
    int cnt = 3;
    while (cnt--)
    {
        std::cout << "线程开始运行了" << std::endl;
    }
}

int main()
{

    std::vector<Thread> threads;

    for (int i = 0; i < 3; i++)
    {
        std::string name = "Thread - ";
        name += std::to_string(i + 1);
        Thread t(test, name);
        threads.push_back(t);
    }

    for(int i = 0;i < 3;i++)
    {
        threads[i].Start();
    }

    for(int i = 0;i < 3;i++)
    {
        threads[i].Join();
    }

    return 0;
}